
#ifndef __AMOUNTFORMAT_H__
#define __AMOUNTFORMAT_H__

#include <Amount.h>
#include <ostream>

class OutFormat
{
public:
	virtual void outPutFormat(std::ostream& out, const Amount& amount)  = 0;
};

class OutPutFormatInAllUnit: public OutFormat
{
public:
	static OutFormat& getOutPutFormat();
	virtual void outPutFormat(std::ostream& out, const Amount& amount) ;
};

class OutPutFormatInBaseUnit: public OutFormat
{
public:
	static OutFormat& getOutPutFormat();
	virtual void outPutFormat(std::ostream& out, const Amount& amount) ;
};

#define IN_ALL_UNIT	OutPutFormatInAllUnit::getOutPutFormat()
#define IN_BASE_UNIT	OutPutFormatInBaseUnit::getOutPutFormat()


class AmountFormat
{
public:
	AmountFormat(Amount & amount, OutFormat& outFormat);
	friend std::ostream& operator << (std::ostream& out, AmountFormat& amountFormat);

private:
	Amount & amount_m;
	OutFormat& outFormat_m;
};

#endif


